n = 6


def f1():
    print(F'f1: {n}')


def f2(change):
    global n  # 设置函数内部定义的变量为全局变量
    if change:
        n = 888
    print(F'f2: {n}')


f1()
f2(False)
print(n)

f2(True)
f1()
print(n)
